<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    body{
      perspective: 500px;
    }
    .box{
      position: relative;
      width: 200px;
      height: 200px;
      margin: 200px auto;
      transition: all 1s;
      transform-style: preserve-3d;
    }
    .box div{
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: pink;
    }
    .box div:last-child{
      background: purple;
      transform: rotateX(60deg);
    }
    .box:hover{
      transform: rotateY(360deg);
    }
  </style>
</head>
<body>
<div class="box">
  <div></div>
  <div>
  </div>
</div>
</body>
</html>
